import Vue from 'vue'
import Router from 'vue-router'
// import Home from "../components/Home";

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            redirect:'/login',
            // component: resolve => require(['@/components/Login'], resolve)
        },
        {
            path: '/login',
            name: 'Login',
            component: resolve => require(['@/components/Login'], resolve)
        },
        {
            path: '*',
            name: 'NotFound',
            component: resolve => require(['@/components/NotFound'], resolve)
        },
        {
            path: '/home',
            // component: Home
            //路由懒加载
            // component: () => import('@/components/Home')
            //异步组件
            component: resolve => require(['@/components/Home'], resolve)
        }
    ],
    mode: 'history'
})
